<?php
    function guanlian($v){
        if(!empty($v['module']) && !empty($v['record_id'])){
            return '<a href="/'.$v['module'].'/read/id/'.$v['record_id'].'">预览</a>';
        }
    }
    function yulan($v){
        return '<a href="'.$v['savepath'].$v['savename'].'" target="_blank">预览</a>';
    }
?>
<div class="page-list-form">
	<div class="layui-btn-group">
		<a href="__APP__/Attach/add.html" class="layui-btn layui-btn-primary"><i class="layui-icon layui-icon-add-1"></i>添加</a>
		<a href="__APP__/Attach/del.html" class="layui-btn layui-btn-primary confirm ajax"><i class="layui-icon layui-icon-close"></i>删除</a>
	</div>
	<div class="page-filter fr">
		<form class="layui-form layui-form-pane" action="__APP__/Attach/index.html" method="get">
		<div class="layui-form-item">
			
			<div class="layui-input-inline">
				<input type="text" name="keywords" lay-verify="required" placeholder="请输入关键词搜索" autocomplete="off" class="layui-input">
				<button class="layui-icon">&#xe615;</button>
			</div>
		</div>
		</form>
	</div>
	<div class="layui-form">
		{Data:list name="Attach"}
		<table class="layui-table mt10" lay-even="" lay-skin="row">
			<colgroup>
				<col width="50">
			</colgroup>
			<thead>
				<tr>
					<th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
					<th>标题</th>
					<th>类型</th>
					<th>大小</th>
					<th>预览</th>
					<th>关联</th>
					<th>创建时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{volist name="var.list" id="vo"}
				<tr>
					<td><input type="checkbox" name="id[]" value="{$vo.id}" class="layui-checkbox checkbox-ids" lay-skin="primary"></td>
					<td>{$vo.name}</td>
					<td>{$vo.type}</td>
					<td>{$vo.size}</td>
					<td>{$vo|yulan}</td>
					<td>{$vo|guanlian}</td>
					<td>{$vo.create_time}</td>
					<td>
						<div class="layui-btn-group">
							<div class="layui-btn-group">
								<a href="__APP__/Attach/edit/id/{$vo.id}.html" class="layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon layui-icon-edit"></i></a>
								<a href="__APP__/Attach/del/ids/{$vo.id}.html" class="layui-btn layui-btn-primary layui-btn-sm ajax"><i class="layui-icon layui-icon-close"></i></a>
							</div>
						</div>
					</td>
				</tr>
				{/volist}
			</tbody>
		</table>
		{$var.page|raw}
		{/Data:list}
	</div>
</div>
